function formatBoolean(row, column) {
  const item = row[column.property]
  if (item === '1') {
    return '是'
  }
  else {
    return '否'
  }
}
export const columns = [
  // {
  //   type: 'index',
  //   minWidth: '50',
  //   fixed: 'left',
  //   label: ''
  // },
  {
    prop: 'propertyName',
    minWidth: '150',
    fixed: 'left',
    label: '属性名称',
  },
  {
    prop: 'columnInputTypeGoodName',
    minWidth: '200',
    label: '字段输入类型（商品属性）'
  },
  {
    prop: 'columnInputTypePurchaserName',
    minWidth: '200',
    label: '字段输入类型（采购属性）'
  },
  {
    prop: 'propertyPrefix',
    minWidth: '150',
    label: '商品属性前缀'
  },
  {
    prop: 'propertySuffix',
    minWidth: '150',
    label: '商品属性后缀'
  },
  {
    prop: 'sorts',
    minWidth: '80',
    label: '排序'
  },
  {
    prop: 'v',
    minWidth: '150',
    label: '是否有效',
    formatter: formatBoolean
  },
  // {
  //   prop: 'columnType',
  //   minWidth: '150',
  //   label: '商品属性字段类型'
  // },
  {
    prop: 'columnSize',
    minWidth: '150',
    label: '商品属性字段大小'
  },
  {
    prop: 'isMain',
    minWidth: '150',
    label: '是否主要属性',
    formatter: formatBoolean
  },
  {
    prop: 'isPurchaserMust',
    minWidth: '150',
    label: '采购人是否必选',
    formatter: formatBoolean
  },
  {
    prop: 'isSupplierMust',
    minWidth: '150',
    label: '供应商是否必选',
    formatter: formatBoolean
  },
  {
    prop: 'isSearch',
    minWidth: '150',
    label: '是否筛选',
    formatter: formatBoolean
  },
  {
    prop: 'isPurchaseSearch',
    minWidth: '150',
    label: '按需采购属性筛选',
    formatter: formatBoolean
  },
  {
    fixed: 'right',
    minWidth: '100',
    label: '操作',
    slotName: 'operation'
  }
]

export const dialogColumns = [
  {
    type: 'index',
    minWidth: '50',
    label: '序号'
  },
  {
    prop: 'propertyValue',
    width: '140',
    label: '商品属性值',
    slotName: 'propertyValue'
    // style: 'font-weight: bold;'
  },
  {
    prop: 'sorts',
    minWidth: '100',
    label: '排序'
  },
  {
    prop: 'valueSize',
    minWidth: '200',
    label: '属性值大小'
  },
  {
    prop: 'v',
    minWidth: '100',
    label: '是否有效',
    formatter: formatBoolean
  },
  {
    fixed: 'right',
    minWidth: '100',
    label: '操作',
    slotName: 'operation'
  }
]

export const purchaseDialogColumns = [
  {
    type: 'index',
    width: '60',
    label: '序号'
  },
  {
    prop: 'propertyValuePurchaser',
    width: '140',
    label: '商品显示属性值',
    slotName: 'propertyValuePurchaser'
  },
  {
    prop: 'propertyValueSearch',
    width: '140',
    label: '商品检索属性值',
    slotName: 'propertyValueSearch'
  },
  {
    prop: 'sorts',
    minWidth: '100',
    label: '排序'
  },
  {
    prop: 'v',
    minWidth: '100',
    label: '是否有效',
    formatter: formatBoolean
  },
  {
    fixed: 'right',
    minWidth: '140',
    label: '操作',
    slotName: 'operation'
  }
]
